<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//主页
Route::get('/','views\StaticPagesController@home')->name('home');
//帮助
Route::get('/help','views\StaticPagesController@help')->name('help');
//关于
Route::get('/about','views\StaticPagesController@about')->name('about');
//注册
Route::get('signup','views\UsersController@create')->name('signup');

Route::resource('users','views\UsersController');

//显示登录页面
Route::get('login', 'views\SessionsController@create')->name('login');
//创建新会话（登录）
Route::post('login', 'views\SessionsController@store')->name('login');
//销毁会话（退出登录）
Route::delete('logout', 'views\SessionsController@destroy')->name('logout');


//注册邮箱生成令牌
Route::get('sigup/confirm/{token}','views\UsersController@confirmEmail')->name('confirm_email');

//显示重置密码的邮箱发送页面
Route::get('password/reset','Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
//邮箱发送重设链接
Route::post('password/email','Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
//密码更新页面
Route::get('password/reset/{token}','Auth\ResetPasswordController@showResetForm')->name('password.reset');
//执行密码更新操作
Route::post('password/reset','Auth\ResetPasswordController@reset')->name('password.update');

//微博相关操作
Route::resource('statuses','Views\StatusesController',['only'=>['store','destroy']]);

//获取关注人列表
Route::get('/users/{user}/followings','views\UsersController@followings')->name('users.followings');
//获取粉丝列表
Route::get('/users/{user}/followers','views\UsersController@followers')->name('users.followers');

//关注
Route::post('/users/followers/{user}','service\FollowersController@store')->name('followers.store');
//取消关注
Route::delete('/users/followers/{user}','service\FollowersController@destroy')->name('followers.destroy');
